package cn.lgp6.ziyou_util.common.result;

/*返回结果构造器*/
public class RequestResultBuilder {
    private static final String successCode="0";
    private static final String failCode="1";
    private static final String errorCode="2";
    public static RequestResult success(){
        return new RequestResult(successCode,"操作成功",null);
    }
    public static RequestResult success(String msg){
        return new RequestResult(successCode,msg,null);
    }
    public static RequestResult success(Object data){
        return new RequestResult(successCode,"操作成功",data);
    }
    public static RequestResult success(String msg,Object data){
        return new RequestResult(successCode,msg,data);
    }
    public static RequestResult fail(String msg){
        return new RequestResult(failCode,msg,null);
    }
    public static RequestResult error(String msg){
        return new RequestResult(errorCode,msg+"," +
                "\n经检查异常信息后若确认为系统BUG," +
                "欢迎发送邮件至lgp1022@foxmail.com反馈,好的作品," +
                "我们一同完善!" +
                "(如果确认BUG属实也有可能会考虑邀请您加入本项目开源贡献组," +
                "一同打造优质高效代码!)",null);
    }
}
